<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 <meta name="Page-topic" content="m16up()" />
 <meta name="Description" content="ST-Open Libraries: m16up()" />
 <meta name="Keywords" content="ST-Open Software, Open Source, ST-Open, Software, Library, Libraries, free Software, Assembler, C" />
 <meta name="date" content="2009-05-08T00:00:00+00:00" />
 <meta name="robots" content="index,follow" />
 <meta name="revisit-after" content="14 days" />
 <meta name="generator" content="Bernhard Schornak, handwritten" />
 <style type="text/css"><!--@import "../../st.css";--></style>
 <link rel="SHORTCUT ICON" href="../../../../pics/favicon.ico" />
 <title>m16up()</title>
</head>
<body id="top">
<div class="pagehd">
<div id="menu">
<ul>
 <li><a href="../../../indexe.htm">Software</a></li>
 <li><a href="../tut/index.htm">Tutorials</a></li>
 <li><a href="../index.htm">Documentation</a></li>
 <li><a href="../alp.htm">alphabetical</a></li>
 <li><a href="../fct.htm">by Function</a></li>
</ul>
</div>
<div class="update">[2009-05-08]</div><div class="headpc"><img src="../../pics/ste.png" alt="SourceDoc Logo" width="75" height="75" border="0" /></div>
</div>
<div class="crlf1"></div>
&#160;&#160;&#160;<a href="../index.htm"><img src="../../../../pics/nav_up.png" alt="up" width="20" height="20" border="0" title="up" /></a>
&#160;&#160;&#160;<a href="aud07.htm"><img src="../../../../pics/nav_bk.png" alt="previous" width="20" height="20" border="0" title="previous" /></a>
&#160;&#160;&#160;<a href="aud09.htm"><img src="../../../../pics/nav_fw.png" alt="next" width="20" height="20" border="0" title="next" /></a>
<div class="text100"><div class="inner">..\st7\lib\sources\aud\low.S</div><div class="outer"><big>aud.lib</big></div></div>
<div class="crlf1"></div>
<div class="text100"><div class="inner"><b>m16up</b></div><div class="outer">Function</div></div>
<div class="crlf0"></div>
<div class="text100"><div class="inner">rc = m16up(source, target, samples);</div><div class="outer">Call</div></div>
<div class="crlf0"></div>
<div class="text100"><div class="inner">
<div class="inners">VOID *</div>
<div class="inners">source</div>
<div class="innerl">address source</div>
<div class="crlf0"></div>
<div class="inners">VOID *</div>
<div class="inners">target</div>
<div class="innerl">address targets</div>
<div class="crlf0"></div>
<div class="inners">DD</div>
<div class="inners">samples</div>
<div class="innerl">samples to convert</div>
</div><div class="outer">Input</div></div><div class="crlf0"></div>
<div class="text100"><div class="inner">
<div class="inners">DD</div>
<div class="inners">rc</div>
<div class="innerl">errors see source</div>
</div><div class="outer">Output</div></div><div class="crlf0"></div>
<div class="text100"><div class="inner">
m16up() converts monaural 16 bit samples to double sampling rate. Only conversions 11.025 to 22.050 samples/s or 22.050 to 44.100 samples/s are supported.
 All other sampling rates require very complex computations beyond my math knowledge... :)
<div class="crlf1"></div>
The function adds two consecutive samples and divides their sum by two. This interpolated value is stored between both samples to "stretch" the wave file
 to double sampling rate. The resulting [target] is twice as large as [source].
<div class="crlf1"></div>
[source] and [target] must point to the first sample to convert. Hence, you may convert larger WAV files in chunks to reduce memory consumption.
</div><div class="outer">Description</div></div><div class="crlf0"></div>
<div class="text100"><div class="inner">
<pre>
DD MyFunction(VOID *source, VOID *target)
{
 DD rc;
 rc = m16up(source, target, 0x2000);
 return(rc);
}
</pre>
8,192 16 bit samples from [source] are stretched to 16,384 16 bit samples and stored in [target].
</div><div class="outer">Example</div></div>
<div class="crlf2"></div>
&#160;&#160;&#160;<a href="../index.htm"><img src="../../../../pics/nav_up.png" alt="up" width="20" height="20" border="0" title="up" /></a>
&#160;&#160;&#160;<a href="aud07.htm"><img src="../../../../pics/nav_bk.png" alt="previous" width="20" height="20" border="0" title="previous" /></a>
&#160;&#160;&#160;<a href="aud09.htm"><img src="../../../../pics/nav_fw.png" alt="next" width="20" height="20" border="0" title="next" /></a>
<div class="crlf1"></div>
&#160;&#160;&#160;<a href="http://validator.w3.org/check?uri=http%3A%2F%2Fst-open.com%2Fst-open%2Fdoc%2Fe%2Fmsc%2Faud08.htm">
<img src="../../../../pics/xhtml.png" alt="validHTML" width="100" height="35" border="0" title="validate XHTML" /></a>
<div class="crlf1"></div>
</body>
</html>
